import SimpleSchema from 'simpl-schema';
import { Schemas } from './Schemas';
import { Random } from 'meteor/random';

Schemas.Feedback = new SimpleSchema({
  userId: {
    type: String
  },
  details: {
    type: Object,
    blackbox: true
  },
  createdAt: {
    type: Date,
    autoValue: function () {
      if (this.isInsert) {
        return new Date();
      } else if (this.isUpsert) {
        return { $setOnInsert: new Date() };
      } else {
        this.unset();
      }
    }
  }
});